-
-
Notifications
You must be signed in to change notification settings - Fork 534
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: support for nested ignore files #5195
Conversation
Some dbg! and println! calls are not removed? 👀 |
6359dd1
to
25ae4d9
Compare
Addressed, I had the commit not pushed. Thank you! |
25ae4d9
to
770b708
Compare
Parser conformance results onjs/262
jsx/babel
symbols/microsoft
ts/babel
ts/microsoft
|
CodSpeed Performance ReportMerging #5195 will not alter performanceComparing Summary
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, thank you for the great improvement 🚀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just two last comments 👍
Co-authored-by: Naoki Ikeguchi <[email protected]>
Co-authored-by: Naoki Ikeguchi <[email protected]>
Co-authored-by: Arend van Beelen jr. <[email protected]>
Co-authored-by: Arend van Beelen jr. <[email protected]>
Co-authored-by: Arend van Beelen jr. <[email protected]>
Co-authored-by: Naoki Ikeguchi <[email protected]>
443d233
to
08b771a
Compare
Summary
Closes #2312
This PR enables Biome to read and understand nested
.gitignore
files, and eventually ignore them in CLI and LSP.In order to achieve that, I applied the following refactors:
ExtensionHandler
that understands ignore files.DocumentFileSource
, and added a new function calledcan_read
. This function is used in the following placesopen_file_internal
. We bail if Biome can't read a certain filecan_handle
of thetraverse.rs
file. Now Biome won't throw an error if it can read a fileDocument::syntax
, inside the workspace server. This type holds the content a file, and its parsed tree. Now, the parsed tree is aOption
, because a file can be read from disk, but can't be parsed. This the case for ignore files.VcsSettings
. These settings are used to query if a file is ignored.update_project_ignore_files
, which is in charge of updating the projectSettings::vcs_settings
with the ignore files that were discovered after the project was scanned. This method does what the former method did: read the file from disk, and create aGitignore
type. As per the new feature, we now have a rootGitignore
, the ignore file found in the project's root. Then we have a list ofGitgnore
, which represents the nested ignore files; these are different because they must be matched against the folder they are contained to, so they are treated differently.Test Plan
We have very similar tests that were repeated across CLI commands, I removed them and placed them inside the
cases/
folder, using theTemporaryFs
, which should help with the testing.I also tested it manually using our own repository. I did remove
dist/
from the ignore file, and added a new.gitignore
inside the tailwind package. The CLI correctly ignores the file inside thedist/
folder (created upon compilation). I also checked that VSCode, upon file opening, doesn't provide diagnostics and doesn't format the files. Fortunately the logs are helpful and I could see that the file was ignored.